home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4594 < prev    next >
Mailbox/MIME Entity  |  1996-08-06  |  2.4 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6e 65 | 77 73 2e 72 61 69 6e 2e |Path: ne|ws.rain.|
|00000010| 6f 72 67 21 75 73 65 6e | 65 74 0a 46 72 6f 6d 3a |org!usen|et.From:|
|00000020| 20 22 47 75 75 73 20 4c | 65 65 75 77 20 6a 72 2e | "Guus L|eeuw jr.|
|00000030| 22 20 3c 67 75 75 73 6c | 40 65 69 66 66 65 6c 2e |" <guusl|@eiffel.|
|00000040| 63 6f 6d 3e 0a 4e 65 77 | 73 67 72 6f 75 70 73 3a |com>.New|sgroups:|
|00000050| 20 63 6f 6d 70 2e 6c 61 | 6e 67 2e 63 2b 2b 0a 53 | comp.la|ng.c++.S|
|00000060| 75 62 6a 65 63 74 3a 20 | 52 65 3a 20 48 65 6c 70 |ubject: |Re: Help|
|00000070| 21 20 20 50 72 6f 67 72 | 61 6d 20 6e 6f 74 20 70 |! Progr|am not p|
|00000080| 61 75 73 69 6e 67 20 61 | 74 20 27 63 69 6e 20 3e |ausing a|t 'cin >|
|00000090| 3e 27 0a 44 61 74 65 3a | 20 54 75 65 2c 20 33 30 |>'.Date:| Tue, 30|
|000000a0| 20 4a 61 6e 20 31 39 39 | 36 20 31 35 3a 33 36 3a | Jan 199|6 15:36:|
|000000b0| 35 36 20 2d 30 38 30 30 | 0a 4f 72 67 61 6e 69 7a |56 -0800|.Organiz|
|000000c0| 61 74 69 6f 6e 3a 20 49 | 6e 74 65 72 61 63 74 69 |ation: I|nteracti|
|000000d0| 76 65 20 53 6f 66 74 77 | 61 72 65 20 45 6e 67 69 |ve Softw|are Engi|
|000000e0| 6e 65 65 72 69 6e 67 20 | 49 6e 63 2e 20 68 68 74 |neering |Inc. hht|
|000000f0| 70 3a 2f 2f 77 77 77 2e | 65 69 66 66 65 6c 2e 63 |p://www.|eiffel.c|
|00000100| 6f 6d 2f 0a 4d 65 73 73 | 61 67 65 2d 49 44 3a 20 |om/.Mess|age-ID: |
|00000110| 3c 33 31 30 45 41 42 39 | 38 2e 33 42 36 36 38 44 |<310EAB9|8.3B668D|
|00000120| 38 40 65 69 66 66 65 6c | 2e 63 6f 6d 3e 0a 52 65 |8@eiffel|.com>.Re|
|00000130| 66 65 72 65 6e 63 65 73 | 3a 20 3c 34 65 6c 64 38 |ferences|: <4eld8|
|00000140| 34 24 62 64 37 40 68 70 | 35 2e 6f 6e 6c 69 6e 65 |4$bd7@hp|5.online|
|00000150| 2e 61 70 70 6c 65 2e 63 | 6f 6d 3e 0a 4e 4e 54 50 |.apple.c|om>.NNTP|
|00000160| 2d 50 6f 73 74 69 6e 67 | 2d 48 6f 73 74 3a 20 40 |-Posting|-Host: @|
|00000170| 6f 75 74 62 61 63 6b 2e | 65 69 66 66 65 6c 2e 63 |outback.|eiffel.c|
|00000180| 6f 6d 0a 4d 69 6d 65 2d | 56 65 72 73 69 6f 6e 3a |om.Mime-|Version:|
|00000190| 20 31 2e 30 0a 43 6f 6e | 74 65 6e 74 2d 54 79 70 | 1.0.Con|tent-Typ|
|000001a0| 65 3a 20 74 65 78 74 2f | 70 6c 61 69 6e 3b 20 63 |e: text/|plain; c|
|000001b0| 68 61 72 73 65 74 3d 75 | 73 2d 61 73 63 69 69 0a |harset=u|s-ascii.|
|000001c0| 43 6f 6e 74 65 6e 74 2d | 54 72 61 6e 73 66 65 72 |Content-|Transfer|
|000001d0| 2d 45 6e 63 6f 64 69 6e | 67 3a 20 37 62 69 74 0a |-Encodin|g: 7bit.|
|000001e0| 58 2d 4d 61 69 6c 65 72 | 3a 20 4d 6f 7a 69 6c 6c |X-Mailer|: Mozill|
|000001f0| 61 20 32 2e 30 62 33 20 | 28 58 31 31 3b 20 49 3b |a 2.0b3 |(X11; I;|
|00000200| 20 4c 69 6e 75 78 20 31 | 2e 32 2e 38 20 69 35 38 | Linux 1|.2.8 i58|
|00000210| 36 29 0a 54 6f 3a 20 44 | 61 76 69 64 52 65 61 20 |6).To: D|avidRea |
|00000220| 3c 64 61 76 69 64 72 65 | 61 40 65 77 6f 72 6c 64 |<davidre|a@eworld|
|00000230| 2e 63 6f 6d 3e 0a 43 43 | 3a 20 67 75 75 73 6c 40 |.com>.CC|: guusl@|
|00000240| 65 69 66 66 65 6c 2e 63 | 6f 6d 0a 0a 44 61 76 69 |eiffel.c|om..Davi|
|00000250| 64 52 65 61 20 77 72 6f | 74 65 3a 0a 3e 20 0a 3e |dRea wro|te:.> .>|
|00000260| 20 53 6f 6d 65 74 69 6d | 65 73 20 6d 79 20 70 72 | Sometim|es my pr|
|00000270| 6f 67 72 61 6d 73 20 64 | 6f 6e 27 74 20 70 61 75 |ograms d|on't pau|
|00000280| 73 65 20 74 6f 20 77 61 | 69 74 20 66 6f 72 20 69 |se to wa|it for i|
|00000290| 6e 70 75 74 0a 3e 20 61 | 74 20 27 63 69 6e 20 3e |nput.> a|t 'cin >|
|000002a0| 3e 27 2e 20 20 41 6c 73 | 6f 20 61 74 20 63 69 6e |>'. Als|o at cin|
|000002b0| 2e 67 65 74 6c 69 6e 65 | 28 29 2c 20 65 74 63 2e |.getline|(), etc.|
|000002c0| 20 20 53 6f 20 66 61 72 | 20 49 20 63 61 6e 27 74 | So far| I can't|
|000002d0| 0a 3e 20 74 65 6c 6c 20 | 77 68 61 74 20 74 68 65 |.> tell |what the|
|000002e0| 20 64 69 66 66 65 72 65 | 6e 63 65 20 69 73 20 62 | differe|nce is b|
|000002f0| 65 74 77 65 65 6e 20 70 | 72 6f 67 72 61 6d 73 20 |etween p|rograms |
|00000300| 74 68 61 74 20 70 61 75 | 73 65 0a 3e 20 61 73 20 |that pau|se.> as |
|00000310| 65 78 70 65 63 74 65 64 | 20 61 6e 64 20 70 72 6f |expected| and pro|
|00000320| 67 72 61 6d 73 20 74 68 | 61 74 20 64 6f 6e 27 74 |grams th|at don't|
|00000330| 2e 0a 3e 20 0a 3e 20 49 | 20 61 73 73 75 6d 65 20 |..> .> I| assume |
|00000340| 74 68 69 73 20 68 61 73 | 20 73 6f 6d 65 74 68 69 |this has| somethi|
|00000350| 6e 67 20 74 6f 20 64 6f | 20 77 69 74 68 20 6d 79 |ng to do| with my|
|00000360| 20 69 6e 70 75 74 20 62 | 75 66 66 65 72 73 20 68 | input b|uffers h|
|00000370| 61 76 69 6e 67 0a 3e 20 | 73 74 75 66 66 20 69 6e |aving.> |stuff in|
|00000380| 20 74 68 65 6d 2e 20 20 | 41 6e 79 20 61 64 76 69 | them. |Any advi|
|00000390| 63 65 20 6f 6e 3a 20 61 | 29 20 57 68 61 74 20 69 |ce on: a|) What i|
|000003a0| 73 20 67 6f 69 6e 67 20 | 6f 6e 3f 20 62 29 20 41 |s going |on? b) A|
|000003b0| 20 73 75 72 65 66 69 72 | 65 0a 3e 20 77 61 79 20 | surefir|e.> way |
|000003c0| 74 6f 20 6d 61 6b 65 20 | 73 75 72 65 20 6d 79 20 |to make |sure my |
|000003d0| 62 75 66 66 65 72 73 20 | 61 72 65 20 63 6c 65 61 |buffers |are clea|
|000003e0| 72 3f 0a 3e 20 0a 3e 20 | 54 68 61 6e 6b 73 2c 0a |r?.> .> |Thanks,.|
|000003f0| 3e 20 2d 2d 44 61 76 69 | 64 20 52 65 61 0a 0a 09 |> --Davi|d Rea...|
|00000400| 49 20 61 73 73 75 6d 65 | 20 79 6f 75 72 20 60 73 |I assume| your `s|
|00000410| 74 64 69 6e 27 20 69 73 | 20 6e 6f 74 20 72 65 64 |tdin' is| not red|
|00000420| 69 72 65 63 74 65 64 20 | 28 69 2e 65 2e 20 79 6f |irected |(i.e. yo|
|00000430| 75 20 61 72 65 20 72 65 | 61 64 69 6e 67 20 66 72 |u are re|ading fr|
|00000440| 6f 6d 20 74 68 65 0a 6b | 65 79 62 6f 61 72 64 29 |om the.k|eyboard)|
|00000450| 2e 0a 0a 09 57 68 65 6e | 20 74 68 65 73 65 20 73 |....When| these s|
|00000460| 79 6d 70 74 6f 6d 73 20 | 73 68 6f 77 20 75 70 2c |ymptoms |show up,|
|00000470| 20 6d 6f 73 74 20 6f 66 | 20 74 68 65 20 74 69 6d | most of| the tim|
|00000480| 65 20 74 68 65 20 75 73 | 65 72 20 6a 75 73 74 20 |e the us|er just |
|00000490| 68 61 64 20 74 6f 20 74 | 79 70 65 0a 61 20 6e 6f |had to t|ype.a no|
|000004a0| 6e 20 60 63 68 61 72 2a | 27 20 74 79 70 65 64 20 |n `char*|' typed |
|000004b0| 76 61 6c 75 65 20 28 65 | 2e 67 2e 20 61 6e 20 69 |value (e|.g. an i|
|000004c0| 6e 74 65 67 65 72 2c 20 | 61 20 63 68 61 72 61 63 |nteger, |a charac|
|000004d0| 74 65 72 20 65 74 63 2e | 29 2e 0a 0a 09 54 68 69 |ter etc.|)....Thi|
|000004e0| 73 20 69 73 20 62 65 63 | 61 75 73 65 20 61 6c 6c |s is bec|ause all|
|000004f0| 20 74 68 65 20 69 6e 74 | 65 72 6e 61 6c 20 61 73 | the int|ernal as|
|00000500| 63 69 69 20 63 6f 6e 76 | 65 72 73 69 6f 6e 20 72 |cii conv|ersion r|
|00000510| 6f 75 74 69 6e 65 73 20 | 77 69 6c 6c 20 72 65 61 |outines |will rea|
|00000520| 64 0a 75 70 74 6f 20 74 | 68 65 20 66 69 72 73 74 |d.upto t|he first|
|00000530| 20 6e 65 78 74 20 63 68 | 61 72 61 63 74 65 72 20 | next ch|aracter |
|00000540| 74 68 65 79 20 63 61 6e | 6e 6f 74 20 64 65 61 6c |they can|not deal|
|00000550| 20 77 69 74 68 2e 0a 0a | 09 46 6f 72 20 65 78 61 | with...|.For exa|
|00000560| 6d 70 6c 65 3a 20 54 68 | 65 20 75 73 65 72 2c 20 |mple: Th|e user, |
|00000570| 70 72 6f 6d 70 74 65 64 | 20 74 6f 20 74 79 70 65 |prompted| to type|
|00000580| 20 61 6e 20 69 6e 74 65 | 67 65 72 2c 20 77 69 6c | an inte|ger, wil|
|00000590| 6c 20 70 72 65 73 73 20 | 60 45 6e 74 65 72 27 0a |l press |`Enter'.|
|000005a0| 74 6f 20 69 6e 64 69 63 | 61 74 65 20 74 68 61 74 |to indic|ate that|
|000005b0| 20 73 68 65 2f 68 65 20 | 69 73 20 72 65 61 64 79 | she/he |is ready|
|000005c0| 20 77 69 74 68 20 65 64 | 69 74 69 6e 67 2e 20 54 | with ed|iting. T|
|000005d0| 68 65 20 69 6e 74 65 72 | 6e 61 6c 20 63 6f 6e 76 |he inter|nal conv|
|000005e0| 65 72 73 69 6f 6e 2c 0a | 74 68 65 6e 2c 20 77 69 |ersion,.|then, wi|
|000005f0| 6c 6c 20 72 65 61 64 20 | 6a 75 73 74 20 74 68 65 |ll read |just the|
|00000600| 20 63 68 61 72 61 63 74 | 65 72 73 20 74 68 61 74 | charact|ers that|
|00000610| 20 6d 61 70 20 61 20 64 | 69 67 69 74 2e 20 49 6e | map a d|igit. In|
|00000620| 20 6f 74 68 65 72 20 77 | 6f 72 64 73 2c 20 69 74 | other w|ords, it|
|00000630| 0a 77 69 6c 6c 20 60 75 | 6e 67 65 74 27 20 74 68 |.will `u|nget' th|
|00000640| 65 20 6e 65 77 6c 69 6e | 65 20 63 68 61 72 61 63 |e newlin|e charac|
|00000650| 74 65 72 2e 0a 0a 09 4e | 6f 77 2c 20 74 68 65 20 |ter....N|ow, the |
|00000660| 6e 65 78 74 20 69 6e 70 | 75 74 20 77 69 6c 6c 20 |next inp|ut will |
|00000670| 69 6d 65 64 69 61 74 65 | 6c 79 20 61 73 73 75 6d |imediate|ly assum|
|00000680| 65 20 74 68 61 74 20 74 | 68 65 20 75 73 65 72 20 |e that t|he user |
|00000690| 69 73 20 64 6f 6e 65 20 | 77 69 74 68 0a 65 64 69 |is done |with.edi|
|000006a0| 74 69 6e 67 20 61 6e 64 | 20 74 68 75 73 20 64 6f |ting and| thus do|
|000006b0| 20 74 68 65 20 63 6f 6e | 76 65 72 73 69 6f 6e 20 | the con|version |
|000006c0| 28 69 66 20 74 68 69 73 | 20 69 73 20 6e 65 65 64 |(if this| is need|
|000006d0| 65 64 29 2e 20 49 66 20 | 74 68 65 20 75 73 65 72 |ed). If |the user|
|000006e0| 20 68 61 64 0a 74 6f 20 | 74 79 70 65 20 6f 74 68 | had.to |type oth|
|000006f0| 65 72 20 74 68 61 6e 20 | 61 20 73 74 72 69 6e 67 |er than |a string|
|00000700| 2c 20 69 74 20 77 69 6c | 6c 20 72 65 73 75 6c 74 |, it wil|l result|
|00000710| 20 69 6e 20 61 6e 20 65 | 6d 70 74 79 20 72 65 73 | in an e|mpty res|
|00000720| 75 6c 74 2e 2e 2e 0a 0a | 09 57 68 61 74 20 74 6f |ult.....|.What to|
|00000730| 20 64 6f 2c 20 74 6f 20 | 6d 61 6b 65 20 74 68 69 | do, to |make thi|
|00000740| 6e 67 73 20 77 6f 72 6b | 3f 20 41 6c 77 61 79 73 |ngs work|? Always|
|00000750| 20 62 65 20 63 61 72 65 | 66 75 6c 20 77 69 74 68 | be care|ful with|
|00000760| 20 75 73 65 72 20 69 6e | 70 75 74 2e 20 49 66 0a | user in|put. If.|
|00000770| 74 68 65 20 75 73 65 72 | 20 74 79 70 65 73 20 73 |the user| types s|
|00000780| 74 75 66 66 20 66 72 6f | 6d 20 74 68 65 20 6b 65 |tuff fro|m the ke|
|00000790| 79 62 6f 61 72 64 2c 20 | 79 6f 75 20 73 68 6f 75 |yboard, |you shou|
|000007a0| 6c 64 20 63 61 6c 6c 20 | 60 63 69 6e 2e 67 65 74 |ld call |`cin.get|
|000007b0| 6c 69 6e 65 28 29 27 0a | 77 68 65 6e 65 76 65 72 |line()'.|whenever|
|000007c0| 20 69 74 20 68 61 73 20 | 62 65 65 6e 20 6f 74 68 | it has |been oth|
|000007d0| 65 72 20 74 68 61 6e 20 | 60 63 68 61 72 2a 27 2e |er than |`char*'.|
|000007e0| 0a 0a 09 49 20 61 6d 20 | 61 77 61 72 65 20 74 68 |...I am |aware th|
|000007f0| 61 74 20 74 68 69 73 20 | 77 69 6c 6c 20 6e 6f 74 |at this |will not|
|00000800| 20 61 6c 77 61 79 73 20 | 77 6f 72 6b 20 28 72 65 | always |work (re|
|00000810| 64 69 72 65 63 74 20 73 | 74 64 69 6e 20 74 6f 20 |direct s|tdin to |
|00000820| 62 65 20 61 0a 66 69 6c | 65 29 2c 20 62 75 74 20 |be a.fil|e), but |
|00000830| 66 6f 72 20 75 73 65 72 | 20 69 6e 70 75 74 20 28 |for user| input (|
|00000840| 77 68 65 72 65 20 79 6f | 75 20 61 72 65 20 73 75 |where yo|u are su|
|00000850| 72 65 20 69 74 20 6d 75 | 73 74 20 62 65 20 74 68 |re it mu|st be th|
|00000860| 65 20 75 73 65 72 29 2c | 20 74 68 69 73 0a 77 69 |e user),| this.wi|
|00000870| 6c 6c 20 77 6f 72 6b 2e | 0a 0a 09 59 6f 75 20 63 |ll work.|...You c|
|00000880| 61 6e 20 62 65 20 61 20 | 6c 69 74 74 6c 65 20 62 |an be a |little b|
|00000890| 69 74 20 73 6d 61 72 74 | 65 72 20 74 68 61 6e 20 |it smart|er than |
|000008a0| 61 62 6f 76 65 2c 20 77 | 68 65 6e 20 79 6f 75 20 |above, w|hen you |
|000008b0| 65 78 61 6d 69 6e 65 20 | 74 68 65 20 69 6e 70 75 |examine |the inpu|
|000008c0| 74 0a 62 75 66 66 65 72 | 20 65 76 65 72 79 74 69 |t.buffer| everyti|
|000008d0| 6d 65 65 20 61 6e 20 69 | 6e 70 75 74 20 68 61 73 |mee an i|nput has|
|000008e0| 20 6f 63 63 75 72 72 65 | 64 2e 20 46 6f 72 20 65 | occurre|d. For e|
|000008f0| 78 61 6d 70 6c 65 3a 0a | 0a 09 69 6e 74 20 61 3b |xample:.|..int a;|
|00000900| 0a 09 63 68 61 72 20 74 | 65 6d 70 3b 0a 0a 09 63 |..char t|emp;...c|
|00000910| 69 6e 20 3e 3e 20 61 3b | 0a 09 74 65 6d 70 20 3d |in >> a;|..temp =|
|00000920| 20 66 67 65 74 63 28 73 | 74 64 69 6e 29 3b 0a 09 | fgetc(s|tdin);..|
|00000930| 69 66 20 28 74 65 6d 70 | 20 21 3d 20 27 5c 6e 27 |if (temp| != '\n'|
|00000940| 29 0a 09 09 75 6e 67 65 | 74 63 28 27 5c 6e 27 2c |)...unge|tc('\n',|
|00000950| 20 73 74 64 69 6e 29 3b | 0a 0a 0a 48 6f 70 65 20 | stdin);|...Hope |
|00000960| 74 68 69 73 20 6d 61 6b | 65 73 20 74 68 69 6e 67 |this mak|es thing|
|00000970| 73 20 61 20 6c 69 74 74 | 6c 65 20 62 69 74 20 63 |s a litt|le bit c|
|00000980| 6c 65 61 72 65 72 2c 0a | 09 47 75 75 73 20 4c 65 |learer,.|.Guus Le|
|00000990| 65 75 77 20 6a 72 2e 0a | |euw jr..| |
+--------+-------------------------+-------------------------+--------+--------+